Set this property to a value that signifies where the tooltip text is displayed. It can appear above or below for a horizontal slider or on the left or right for a vertical slider.
ToolTipText
The text to display when the users cursor hovers over the slider control.
Value
The value the slider is currently set to.
Using the Slider Control at Runtime
In the Slider sample form, the slider is used to control an employees salary. When the user moves the slider to affect the salary, the text box is updated. Whats more, if the user types a value into the text box, the slider control is updated. First, the Form_Load() event sets a default value for the salary:
Private Sub Form_Load()
txtSalary.Text = Format("30000", "Currency") Call txtSalary_LostFocus End Sub
After the Text property of the text box is set, the LostFocus event of the text box is called:
Private Sub txtSalary_LostFocus() sldSalary.Value = CCur(txtSalary.Text) End Sub
When the user moves out of the text box, the slider control is updated to the new value entered in the text box by setting the Value property of the slider from the Text property of the text box. The Validate event is used to make sure a valid numeric value is entered into the text box:
Private Sub txtSalary_Validate(Cancel As Boolean)
If CCur(txtSalary.Text) < sldSalary.Min Then
Beep
Cancel = True
End If
If CCur(txtSalary.Text) > sldSalary.Max Then
Beep
Cancel = True
End If
End Sub